package com.service.impl;

import com.entity.Items;
import com.mapper.ItemsMapper;
import com.service.ItemsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service("itemsService")
@Transactional
public class ItemsServiceImpl implements ItemsService {
    @Autowired
    private ItemsMapper itemsMapper;
    @Override
    public void insertItems(Items items) {
        itemsMapper.insertItems(items);
    }

    @Override
    public void deleteItemsById(Integer id) {
        itemsMapper.deleteItemsById(id);
    }

    @Override
    public void updateItems(Items items) {
        itemsMapper.updateItems(items);
    }

    @Override
    public Items selectItemsById(Integer id) {
        return itemsMapper.selectItemsById(id);
    }

    @Override
    public Items selectItemsByName(String name) {
        return itemsMapper.selectItemsByName(name);
    }

    @Override
    public List<Items> selectItems() {
        return itemsMapper.selectItems();
    }

    @Override
    public List<Items> selectPageItems(Integer pageNum, Integer pageSize) {
        return itemsMapper.selectPageItems(pageNum,pageSize);
    }
}
